package com.study.crud.model.user;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

@TableName("user")
public class User implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(value = "uid", type = IdType.AUTO)
    private Integer uid;

    /**
     * 姓名
     * */
    @TableField("uname")
    private String uname;

    /**
     * 性别
     * */
    @TableField("sex")
    private Integer sex;    // 1.男生     2.女生

    /**
     * 出生日期
     * */
    @TableField("birthday")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birthday;

    /**
     * 入职时间
     * */
    @TableField("joinTime")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date joinTime;

    /**
     * 学历
     * */
    @TableField("education")
    private String education;

    /**
     * 职务
     * */
    @TableField("jid")
    private Integer jid;

    /**
     * 住址
     * */
    @TableField("address")
    private String address;

    /**
     * 电话
     * */
    @TableField("phone")
    private String phone;

    /**
     * 紧急电话
     * */
    @TableField("ecPerson")
    private String ecPerson;

    /**
     * 所属部门
     * */
    @TableField("eid")
    private Integer eid;

    /**
     * 对应的密码
     * */
    private Integer pwd;

    @TableField(exist = false)
    private String title;

    @TableField(exist = false)
    private String ename;

    public User() {
    }

    public User(Integer uid, String uname, Integer sex, Date birthday, Date joinTime, String education, Integer jid, String address, String phone, String ecPerson, Integer eid, Integer pwd) {
        this.uid = uid;
        this.uname = uname;
        this.sex = sex;
        this.birthday = birthday;
        this.joinTime = joinTime;
        this.education = education;
        this.jid = jid;
        this.address = address;
        this.phone = phone;
        this.ecPerson = ecPerson;
        this.eid = eid;
        this.pwd = pwd;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public String getUname() {
        return uname;
    }

    public void setUname(String uname) {
        this.uname = uname;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public Date getJoinTime() {
        return joinTime;
    }

    public void setJoinTime(Date joinTime) {
        this.joinTime = joinTime;
    }

    public String getEducation() {
        return education;
    }

    public void setEducation(String education) {
        this.education = education;
    }

    public Integer getJid() {
        return jid;
    }

    public void setJid(Integer jid) {
        this.jid = jid;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getEcPerson() {
        return ecPerson;
    }

    public void setEcPerson(String ecPerson) {
        this.ecPerson = ecPerson;
    }

    public Integer getEid() {
        return eid;
    }

    public void setEid(Integer eid) {
        this.eid = eid;
    }

    public Integer getPwd() {
        return pwd;
    }

    public void setPwd(Integer pwd) {
        this.pwd = pwd;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getEname() {
        return ename;
    }

    public void setEname(String ename) {
        this.ename = ename;
    }
}
